using Godot;
using System;

public partial class VFXBlink : BaseVFX
{
    AnimationPlayer animationPlayer;

    public override void _Ready()
    {
        base._Ready();
        animationPlayer = GetNode<AnimationPlayer>("AnimationPlayer");
        animationPlayer.AnimationFinished += AnimationFinishedHandler;
    }

    private void AnimationFinishedHandler(StringName animName)
    {
        Hide();
        EmitSignal(SignalName.OnVFXEnd);
    }


    public override void Play(Vector2 pos)
    {
        Show();
        Position = pos;
        animationPlayer.Play("blink");
        AudioManager.PlayEffect("start_map_dididi");
    }
}
